package com.jeegit.ecms.service.impl;

import java.util.List;
import com.jeegit.common.utils.DateUtils;
import com.jeegit.common.utils.IdUtils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jeegit.ecms.mapper.CmsVideoTeacherMapper;
import com.jeegit.ecms.domain.CmsVideoTeacher;
import com.jeegit.ecms.service.ICmsVideoTeacherService;
import com.jeegit.common.core.text.Convert;

/**
 * 授课讲师Service业务层处理
 * 
 * @author jeegit
 * @date 2022-06-30
 */
@Service
public class CmsVideoTeacherServiceImpl implements ICmsVideoTeacherService 
{
    @Autowired
    private CmsVideoTeacherMapper cmsVideoTeacherMapper;

    /**
     * 查询授课讲师
     * 
     * @param id 授课讲师主键
     * @return 授课讲师
     */
    @Override
    public CmsVideoTeacher selectCmsVideoTeacherById(Long id)
    {
        return cmsVideoTeacherMapper.selectCmsVideoTeacherById(id);
    }

    /**
     * 查询授课讲师列表
     * 
     * @param cmsVideoTeacher 授课讲师
     * @return 授课讲师
     */
    @Override
    public List<CmsVideoTeacher> selectCmsVideoTeacherList(CmsVideoTeacher cmsVideoTeacher)
    {
        return cmsVideoTeacherMapper.selectCmsVideoTeacherList(cmsVideoTeacher);
    }

    /**
     * 新增授课讲师
     * 
     * @param cmsVideoTeacher 授课讲师
     * @return 结果
     */
    @Override
    public int insertCmsVideoTeacher(CmsVideoTeacher cmsVideoTeacher)
    {
    	cmsVideoTeacher.setId(IdUtils.getInstance(3l).nextId());
    	cmsVideoTeacher.preInsert(cmsVideoTeacher);
        return cmsVideoTeacherMapper.insertCmsVideoTeacher(cmsVideoTeacher);
    }

    /**
     * 修改授课讲师
     * 
     * @param cmsVideoTeacher 授课讲师
     * @return 结果
     */
    @Override
    public int updateCmsVideoTeacher(CmsVideoTeacher cmsVideoTeacher)
    {
    	cmsVideoTeacher.preUpdate(cmsVideoTeacher);
        return cmsVideoTeacherMapper.updateCmsVideoTeacher(cmsVideoTeacher);
    }

    /**
     * 批量删除授课讲师
     * 
     * @param ids 需要删除的授课讲师主键
     * @return 结果
     */
    @Override
    public int deleteCmsVideoTeacherByIds(String ids)
    {
        return cmsVideoTeacherMapper.deleteCmsVideoTeacherByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除授课讲师信息
     * 
     * @param id 授课讲师主键
     * @return 结果
     */
    @Override
    public int deleteCmsVideoTeacherById(Long id)
    {
        return cmsVideoTeacherMapper.deleteCmsVideoTeacherById(id);
    }
}
